package io.gitee.bowen_lee.rpc;

import java.io.Serializable;

/**
 * 1. ooxx值
 * 2. UUID
 * 3. DATA_LEN
 * 
 * @author Bowen
 * @since 2022-01-18 13:58:45
 */
public class BowenHeader implements Serializable {

  int flag; // 0x14141414 16进制8字节 占32位
  long requestID; // 定义 8字节长度的uuid 占 64bit
  long dataLen; // 定义长度为 32位 (16进制8字节.32bit)

  /**
   * 获取 head 长度
   * 
   * @return
   */
  public static int getHeadLen() {
    return (32 + 64 + 32);
  }

  @Override
  public String toString() {
    return "BowenHeader [dataLen=" + dataLen + ", flag=" + flag + ", requestID=" + requestID + "]";
  }

  public int getFlag() {
    return flag;
  }

  public void setFlag(int flag) {
    this.flag = flag;
  }

  public long getRequestID() {
    return requestID;
  }

  public void setRequestID(long requestID) {
    this.requestID = requestID;
  }

  public long getDataLen() {
    return dataLen;
  }

  public void setDataLen(long dataLen) {
    this.dataLen = dataLen;
  }

}
